USER MANUAL

Overview:
This application predicts next-day stock prices using:

* LSTM (deep learning model)
* Linear regression (baseline model)

It also performs backtesting and evaluates model performance.

Running the Program:
Run the full pipeline:
python main.py

Configuration:
Modify parameters in the script or config file:

tickers = ["AAPL", "NVDA"]
start_date = "2019-01-01"
end_date = "2026-01-01"
sequence_length = 30
epochs = 20
forecast_days = 30

Output Files:
outputs/
│
├── plots/
│   ├── AAPL_actual_vs_predicted.png
│   ├── NVDA_actual_vs_predicted.png
│   ├── SP500_direction_accuracy.png
│
├── backtests/
│   ├── AAPL_backtest_predictions.csv
│   ├── NVDA_backtest_predictions.csv
│
├── predictions/
│   ├── forecast_results.json

Understanding Results:

* RMSE / MAE: prediction error
* MAPE: percentage error
* R²: how well model explains variation
* Directional Accuracy: how often model predicts up/down correctly

Graphs:

* Actual vs Predicted: compares predictions to real prices
* Direction Accuracy: compares vs random baseline
* Error Over Time: shows consistency

Customization:

* Change tickers (e.g., TSLA, MSFT)
* Adjust epochs and sequence length
* Modify LSTM architecture

Limitations:

* Cannot predict sudden market shocks
* Direction prediction is near random (~52%)
* Better for short-term trends than long-term forecasting

Troubleshooting:

* Missing package → pip install <package>
* TensorFlow issues → use CPU or WSL2
* No data → check internet or ticker symbol

Summary:
This system predicts stock prices, evaluates performance, and compares machine learning models for educational purposes.
